<?php
class  ProjectsController extends AppController {
	var $uses = array('Project');
	var $layout = 'mainmenu'; 
	 
	function index () {
		if (!empty($this->data['Project']['id'])) {
			$this->Session->write('selectedProject',$this->data['Project']['id']);
			
			$this->redirect(array('controller'=>'dashboards'));
		}
		
		$projects = $this->Project->find("list",array('fields' => array('id','projectName'),'order'=>'projectName'));
		$this->set(compact('projects'));
	}
	
	function add () {
		
	}
	
	function delete () {
		
	}
	
}
?>